const ACCESSTOKEN = "AccessToken";
const REFRESHTOKEN = "RefreshToken";

export function getToken(){
    let token = localStorage.getItem(ACCESSTOKEN);
    return token
}

export function getRefreshToken(){
    let refreshToken = localStorage.getItem(REFRESHTOKEN);
    return refreshToken;
}

export function setToken(accessToken,refreshToken){
    if(accessToken,refreshToken)
    {
        localStorage.setItem(ACCESSTOKEN,accessToken);
        localStorage.setItem(REFRESHTOKEN,refreshToken);
    }
}

// 根据token是否存在，判断当前是否登录
export function isLogin() {
    let token = getToken();
    if (token) {
        return true;
    } else {
        return false;
    }
}